import globalAPI from '@/api/globalAPI'

export default ({ request }) => ({
  /**
   * @description 登录
   * @param {Object} data 登录携带的信息
   */
  SYS_USER_LOGIN (data = {}) {
    var param = new FormData()
    param.append('username', data.username)
    param.append('password', data.password)
    // 接口请求
    return request({
      url: `${globalAPI.BASE_URL}/login`,
      method: 'post',
      data: param
    })
  },

  SYS_USER_LOGOUT () {
    return request({
      url: `${globalAPI.BASE_URL}/logout`,
      method: 'post'
    })
  }
})
